//
//  MCPasswordSettingViewController.m
//  TLYL
//
//  Created by MC on 2017/7/11.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCPasswordSettingViewController.h"
#import "MCSlideView.h"

@interface MCPasswordSettingViewController ()
@property (nonatomic,strong)MCSlideView *segmentedView;

@end

@implementation MCPasswordSettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createUI];
    
}
-(void)createUI{
    if( ([[[UIDevice currentDevice] systemVersion] doubleValue]>=7.0)) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.modalPresentationCapturesStatusBarAppearance = NO;
        self.navigationController.navigationBar.clipsToBounds = NO;
    }
    
    self.view.backgroundColor=RGB(242, 242, 242);
    [self createSlide];
    
}

#pragma mark ================================创建Slide
-(void)createSlide{
    
    self.title = @"密码设置";
    NSArray *array = [NSArray arrayWithObjects:@"资金密码",@"登录密码",nil];
    _segmentedView = [MCSlideView segmentControlViewWithFrame:CGRectMake(0, 0, G_SCREENWIDTH, G_SCREENHEIGHT-64)];
    
    _segmentedView.normalColor = RGB(178, 178, 178);
    _segmentedView.selectedColor = RGB(64, 64, 64 );
    _segmentedView.SlideSelectedColor=RGB(64, 145, 221);
    
    _segmentedView.titleArray = array;
    _segmentedView.selectedTitleArray = array;
    [self.view addSubview:_segmentedView];
    UITapGestureRecognizer *singleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeKeyboard:)];
    singleTapGesture.numberOfTapsRequired = 1;
    singleTapGesture.cancelsTouchesInView = NO;
    [_segmentedView.collectionView addGestureRecognizer:singleTapGesture];
    
    
    
}
#pragma mark - gesture actions
- (void)closeKeyboard:(UITapGestureRecognizer *)recognizer {
    [self.view endEditing:YES];
}
    

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
